<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div>dom</div>
  <script>
    // dataset 存对象的方式两种  
    const div = document.querySelector("div");
    // 1 js的方式
    div.dataset.person = { name: "123" }
    div.dataset.name = 123;
    div.dataset.hello = true;
    div.dataset.list = [1, 2, 3, 4];

    console.log(typeof div.dataset.name);
    console.dir(div.dataset.name);
    let obj = {};
    console.log(obj.toString());

  </script>
</body>

</html>